﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using DAL;
using System.Data;

namespace BLL
{
    public class B_Phong
    {
        public M_Phong GetByPK_PhongID(int PhongID)
        {
            return (new D_Phong()).GetbyPK_PhongID(PhongID);
        }
        
        public DataTable GetAll()
        {
            return (new D_Phong()).GetAll();
        }                             

        public void Insert(M_Phong M_Phong)
        {
            (new D_Phong()).Insert(M_Phong);
        }

        public void Update(M_Phong M_Phong)
        {
            (new D_Phong()).Update(M_Phong);
        }

        public void Delete(int PhongID)
        {
            if (PhongID <= 0)
                throw new Exception("Không hợp lệ! Vui lòng thử lại sau!");
            
            new D_Phong().Delete(PhongID);
        }
    }
}
